package com.haidechizi.util.lock;

import com.haidechizi.util.lock.holder.DistributeLockHolder;

import javax.annotation.PostConstruct;

/**
 * @author: wangdejun
 * @create: 2019-11-12 17:08
 **/
public abstract class AbstractDistributeLock implements DistributeLock {

    /**
     * 利用spring，将lock保存到lockHolder中
     */
    @PostConstruct
    public void init() {
        DistributeLockHolder.putLock(type(), this);
    }

}
